function sendEmail() {

    $.ajax({
            url: '/SendEmail',
            type: "POST",
            data: {
                myemail:$("#verEmail").val(),
            }
            ,
            success: function (data) {
                switch (data['code']){
                    case 0:
                        alert("发送成功");
                        break;
                    case 1:
                        alert("用户不存在！");
                        break;
                }
            }
            ,
            error: function (err) {
                console.log(err);
            }
        }
    );

}

function changePassword() {

    $.ajax({
            url: '/Register',
            type: "POST",
            data: {
                password:hex_md5($("#newPas").val()),
                myemail:$("#myemail").val(),
                action: "changepassword"
            }
            ,
            success: function (data) {
                alert("修改成功！");
            }
            ,
            error: function (err) {
                console.log(err);
            }
        }
    );

}

function checkpassword() {

    var firstpassword = $("#newPas").val();
    var secondpassword = $("#newPasAg").val();

    if (!(firstpassword === secondpassword)){
        alert("两次密码不一致");
        $("#confirm").attr("disabled","disabled");
    }else {
        $("#confirm").removeAttr("disabled");
    }
}
